﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AttributesGroupsServiceLibrary;
using System.Data;

namespace SessionLIB
{
    public class SessionClass
    {
        //Session class is outside of the service classes. We are reusing our wpf to display it.
        //It is a test for our current application to see how it will 
        //eventually interact with other applications.

       // creates attributegroup object
        AttributeGroupsService1 ags_obj = new AttributeGroupsService1();
        private int UserID = 0;

        //------------------constructors ----------------------------
        public SessionClass()//default constructor
        { }

        //constructor for username, doesn't do anything yet :) 
        // can use getUserIDfromUserName(string username) in utility class, but wpf isn't set up to take name
        // not will have to deal with multiple name return for username search
        public SessionClass(string username)
        {

        }

        //constructor for userid
        public SessionClass(int userid)
        {
            UserID = userid;
        }

        //-------------METHODS------------------------

        //next four methods return attribute as different types.  Because Rodney said to make them.
       // should be interface instead? can't override with same parameters
        public string GetAttributeString(int userid)
        {
            string results = "";
            return results;
        }

        public int GetAttributeInt(int userid)
        {
            int results = 0;
            return results;
        }
        public Boolean GetAttributeBoolean(int userid)
        {
            Boolean results = false;
            return results;
        }
        public Double GetAttributeDouble(int userid)
        {
            Double results = 0;

            return results;
        }

//gets user info to display
        public string GetUser()
        {
            string user = "";
            user = ags_obj.GetUser(UserID);
            return user;
        }

 //gets all user's groups to display
        public DataTable GetGroups()
        {
            DataTable groups = new DataTable();
            groups = ags_obj.GetGroups(UserID);
            return groups;
        }

//gets all user's attibutes to display
        public DataTable GetAttributes()
        {
            DataTable attributes = new DataTable();
            attributes = ags_obj.GetAttributes(UserID);
            return attributes;
        }

//gets only attributes from highest ranked group
        public DataTable GetHighestRankedUserAttributes()
        {
            DataTable attributes = new DataTable();
            attributes = ags_obj.GetHighestRankedUserAttributes(UserID);
            return attributes;
        }
    }
}
